feat: Investigate Test Coverage Drop #427
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Towards #426
Discussion
Below is a list of problems affecting our test coverage and possible mitigation steps:
sol!
macros (events, errors, storage) is included in test coverage (effect: high).#[cfg_attr(coverage, coverage(off))]
(see example, and pseudo code is below).#[cfg_attr(coverage, coverage(off))]
.IErc20::transfer
is tested by calling_update
, causing code coverage to registertransfer
as "unconvered") (effect: medium).IErc165
-related tests exist verifying the generatedINTERFACE_ID
value is correct, but no tests exist that call<ContractName>::supports_interface
(effect: low).supports_interface
tests.MethodError
impls uncovered (effect: low).#[cfg_attr(coverage, coverage(off))]
.#[public]
attr is included in coverage (effect: low).#[cfg(test)] mod tests
(unit tests) are included in coverage (effect: none). NOTE: technically not a problem atm, as the effect of this is positive or neutral. If we still wanted to exclude them, see mitigation steps below.#[cfg_attr(coverage, coverage(off))]
#[test]
-related code automatically taiki-e/cargo-llvm-cov#123 (comment)) (this ties into our previous discussion on unit test organization where this was one of the proposals https://openzeppelin.slack.com/archives/C06R5AGFE9G/p1732625889805619?thread_ts=1732618832.030739&cid=C06R5AGFE9G)